package entity;

import messge.WinMessage;

public class Battle {
	private int id;
	private String blackAccount;
	private String whiteAccount;
	private String battleTime;
	private int result;
	
	
	public int getId() {
		return id;
	}
	
	public String getBattleTime() {
		return battleTime;
	}

	public void setBattleTime(String battleTime) {
		this.battleTime = battleTime;
	}

	public void setId(int id) {
		this.id = id;
	}
	public String getBlackAccount() {
		return blackAccount;
	}
	public void setBlackAccount(String blackAccount) {
		this.blackAccount = blackAccount;
	}
	public String getWhiteAccount() {
		return whiteAccount;
	}
	public void setWhiteAccount(String whiteAccount) {
		this.whiteAccount = whiteAccount;
	}
	public int getResult() {
		return result;
	}
	public void setResult(int result) {
		this.result = result;
	}

	@Override
	public String toString() {
		String resultStr = null;
		if(this.result==WinMessage.WIN_MESSEAGE_BLACK) {
			resultStr="黑方胜利";
		}else if(this.result==WinMessage.WIN_MESSEAGE_WHITE) {
			resultStr="白方胜利";
		}else {
			resultStr="平局";
		}
		
		return " 黑方账户：" + blackAccount + ", 白方账户：" + whiteAccount
				+ ", 对战时间:" + battleTime + ", 对战结果：" + resultStr;
	}	
	
	
}
